package collection;

public class DNode<T> extends ANode<T>{
	
	private DNode<T> prev;
	private DNode<T> next;

	DNode()
	{
		this(null, null, null);
	}
	
	DNode(T element)
	{
		this(element, null, null);
	}
	
	private DNode(T element, DNode<T> prev, DNode<T> next)
	{
		super(element);
		this.prev = prev;
		this.next = next;
	}
	
	DNode(DNode<T> newNode)
	{
		this(newNode.element, newNode.prev, newNode.next);
	}
	
	DNode<T> getPrev()
	{
		return this.prev;
	}
	
	void setPrev(DNode<T> prev)
	{
		this.prev = prev;
	}
	
	DNode<T> getNext()
	{
		return this.next;
	}
	
	void setNext(DNode<T> next)
	{
		this.next = next;
	}
	
	@Override
	public void clear()
	{
		super.clear();
		this.prev = null;
		this.next = null;
	}
	
}
